<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>会员注册</title>
<link href="<%=basePath%>skin/css/public.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>skin/css/validform/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/validform/Validform_v5.3.2_min.js"></script>
<script language="javascript">
	 $().ready(function(){
		 $("#validateCodeImg").click(function(){
			 $(this).attr("src","<%=basePath%>/validateCode.shtml?data=" + new Date() + Math.floor(Math.random()*24));
		 });

		 //验证
		 var validform = $("#form1").Validform({
			btnSubmit:"#save",
			tiptype:3
		 });
		 validform.addRule([
			{
			    ele:"#username",
			    datatype:"m",
			    nullmsg:"请输入手机号码！",
			    ajaxurl:"<%=basePath%>checkUsername.shtml"
			},
			{
			    ele:"#password",
			    datatype:"*",
			    nullmsg:"请输入密码！"
			},
			{
			    ele:"#cfpassword",
			    datatype:"*",
			    nullmsg:"请输入确认密码！",
			    recheck:"password"
			},
			{
			    ele:"#email",
			    datatype:"e",
			    nullmsg:"请输入邮箱！"
			},
			{
			    ele:"#validateCode",
			    datatype:"n",
			    nullmsg:"请输入验证码！"
			}
		 ]);
	 });
</script>
</head>

<body>
	<div class="register">
    	<div class="container">
        	<div class="content">
                <div class="register-content">
                    <div class="stepbar">
                        <h1 class="buy-logo">用户注册</h1><a href="<%=basePath%>"><img src="<%=basePath%>skin/images/logo.png" /></a>
                        <ol class="tb-stepbar">
                            <li class="step-5 stepbar-current"><span>填写信息</span></li>
                            <li class="step-5 stepbar-last"><span>注册成功</span></li>
                        </ol>
                    </div>
                    <div class="main">
                        <h3>填写信息<span class="had-account">我已经注册，现在就 <a href="<%=basePath%>login.shtml">登陆</a></span></h3>
                        <div class="form-list form-main-list">
			            <form id="form1" name="form1" method="post" action="<%=basePath%>register/save.shtml">
						<input type="hidden" name="redirectUrl" value="${redirectUrl}" />
                            <div class="form-group">
                                 <div class="form-item">
                                    <span class="form-label form-label-b tsl" >设置登陆账户</span>
                                    <span class="tsl">&nbsp;</span>
                                </div>
                                <div class="form-item">
                                    <span class="form-label tsl">手机号码</span>
                                    <input class="form-text" type="text" id="username" name="username" placeholder="请输入手机号码">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="form-item">
                                    <span class="form-label form-label-b tsl" >设置登陆密码</span>
                                    <span class="tsl">&nbsp;</span>
                                </div>
                                <div class="form-item">
                                    <span class="form-label tsl">登陆密码</span>
                                    <input class="form-text" id="password" name="password" type="password" placeholder="请输入登录密码">
                                </div>
                                <div class="form-item">
                                    <span class="form-label tsl">确认密码</span>
                                    <input class="form-text"  id="cfpassword" name="cfpassword" type="password" placeholder="再次输入登入密码">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="form-item">
                                    <span class="form-label form-label-b tsl">设置会员个人资料</span>
                                    <span class="tsl">&nbsp;</span>
                                </div>
                                <div class="form-item">
                                    <span class="form-label tsl" >姓名</span>
                                    <input class="form-text" id="name" name="name" type="text" placeholder="请输入真实姓名">
                                </div>
                                <div class="form-item">
                                    <span class="form-label tsl" >邮箱</span>
                                    <input class="form-text" id="email" name="email" type="text" placeholder="请输入邮箱">
                                </div>
                                <div class="form-item">
                                    <span class="form-label tsl" >验证码</span>
                                    <input class="form-text" name="validateCode" id="validateCode" type="text" placeholder="请输入验证码">
                                    <img id="validateCodeImg" src="<%=basePath%>validateCode.shtml" title="点击图片刷新验证码"/>					
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="form-item">
                                    <span class="form-label form-label-b tsl"></span>
                                    <span class="tsl">
                                        <input type="checkbox" checked disabled/>
                                        	本人已阅读及同意
                                        <p><a href="#">《本公司的网站使用条款》及《私隐条例》</a></p></span>
                                </div>
                                <div class="form-item">
                                    <span class="form-label form-label-b tsl" d></span>
                                    <span class="tsl">
                                        <input type="checkbox" checked disabled/>
                                        	本人不反对贵公司使用以上提供的个人资料用作直接促销用途
                                    </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="form-item">
                                	<input type="button" class="btn btn-large tsl" value="确　定" id="save" />
                                </div>
                            </div>
                        </form>
                        </div>     
                    </div>
                </div>
			</div>
        </div>
    </div>
</body>
</html>